//
//  AddressListTableViewCell.m
//  Products_B
//
//  Created by lanou on 16/6/2.
//  Copyright © 2016年 朋学友. All rights reserved.
//

#import "AddressListTableViewCell.h"

@interface AddressListTableViewCell ()

@property (weak, nonatomic) IBOutlet UILabel *namePhoneLabel;
@property (weak, nonatomic) IBOutlet UILabel *addressTf;

@end

@implementation AddressListTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        UILabel *addressLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 60, 20)];
        addressLabel.text = @"收货地址";
        addressLabel.font = [UIFont systemFontOfSize:12];
        addressLabel.alpha = 0.8;
        [self addSubview:addressLabel];
        
        UILabel *namePhoneLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 40, kWidth - 60, 20)];
        namePhoneLabel.font = [UIFont systemFontOfSize:12];
        namePhoneLabel.alpha = 0.6;
        [self addSubview:namePhoneLabel];
        _namePhoneLabel = namePhoneLabel;
        
        UILabel *morenLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 70, 50, 20)];
        morenLabel.text = @"[默认]";
        morenLabel.font = [UIFont systemFontOfSize:12];
        morenLabel.textColor = [UIColor orangeColor];
        [self.contentView addSubview:morenLabel];
        
        UILabel *addressTf = [[UILabel alloc] initWithFrame:CGRectMake(morenLabel.frame.origin.x + morenLabel.frame.size.width + 10, 70, kWidth - 30, 20)];
        
        addressTf.font = [UIFont systemFontOfSize:12];
        addressTf.alpha = 0.6;
        [self addSubview:addressTf];
        _addressTf = addressTf;
    }
    return self;
}

- (void)awakeFromNib {
    // Initialization code
   // xib初始化时会走这个方法
}

// 重写set方法
- (void)setModel:(ChuanzhiModel *)model {
    _model = model;
    self.namePhoneLabel.text = [NSString stringWithFormat:@"%@    %@",model.nameString,model.phoneString];
    self.addressTf.text = model.addressString;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
